﻿using Network.Extension;
using ProtoBuf;
using System.Collections.Generic;

[ProtoContract]
public class RoomData
{
    [ProtoMember(1)] public uint id;
    [ProtoMember(2)] public string name;
    [ProtoMember(3)] public uint owner;
    [ProtoMember(4)] public List<PlayerData> players = new List<PlayerData>();

    [ProtoMember(5)] public string ip;
    [ProtoMember(6)] public int port;
    [ProtoMember(7)] public int maxPlayers;
    [ProtoMember(8)] public bool isStart;

    public override string ToString()
    {
        return string.Format("<id:{0}, name:{1}, owner:{2}, players:{3}>", id, name, owner, players.ToListString());
    }
}

[ProtoContract]
public class RoomListData
{
    [ProtoMember(1)] public List<RoomData> rooms = new List<RoomData>();
}